package com.chaosyeb.mail;

import com.chaosyeb.server.pojo.MailConstants;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @Description : Mail启动类
 * @Author : Chaos
 * @Date : 2021/12/2 17:30
 * @Version : 1.0
 * // exclude = {DataSourceAutoConfiguration.class}用不到数据库，所以去掉了数据库依赖
 **/
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class MailApplication {
    public static void main(String[] args) {
        SpringApplication.run(MailApplication.class, args);
    }

    /**
     * 监听的队列放到了启动类中
     * @return
     */
    @Bean
    public Queue queue(){
        return new Queue(MailConstants.MAIL_QUEUE_NAME);
    }
}
